#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__

#include "cocos2d.h"

#include "SimpleAudioEngine.h"
USING_NS_CC;

class CRootScene : public cocos2d::CCLayer
{
public:
	CRootScene();
	~CRootScene();

    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
    virtual bool init();  

    // implement the "static node()" method manually
    CREATE_FUNC(CRootScene);

	bool getNextWalkTarget( CCPoint& current );
	CCArray* getEnemyArray(){ return arrEnemys; }
private:
	virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
	bool canBuyTower()const;

	// init functions
	void loadTowerPositions();
	void loadWalkPoints();
	int loadWave( int nWave );
private:
	CCArray* arrTowerBases;
	CCArray* arrTowers;
	CCArray* arrWalkPoints;
	CCArray* arrEnemys;

	CCLabelBMFont* ui_wave_lbl;
	int mWave;
};

bool judgeCollision(CCPoint circlePoint, float radius, CCPoint circlePointTwo, float radiusTwo);

#endif  // __HELLOWORLD_SCENE_H__